package tbs.framework.sql.mapper;

import tbs.framework.sql.query.IPage;
import tbs.framework.sql.query.IQuery;
import tk.mybatis.mapper.additional.idlist.IdListMapper;
import tk.mybatis.mapper.additional.update.batch.BatchUpdateMapper;
import tk.mybatis.mapper.additional.update.batch.BatchUpdateSelectiveMapper;
import tk.mybatis.mapper.common.BaseMapper;
import tk.mybatis.mapper.common.special.InsertListMapper;

import java.util.List;

/**
 * @author abstergo
 */
public interface IFrameworkMapper<T, K>
    extends BaseMapper<T>, InsertListMapper<T>, BatchUpdateMapper<T>, BatchUpdateSelectiveMapper<T>,
    IdListMapper<T, K> {

    /**
     * 根据查询条件查询
     *
     * @param qo
     * @param page
     * @param entityClass
     * @param <E>
     * @param <Q>
     * @return
     */
    <E, Q extends IQuery> List<E> queryByQO(Q qo, IPage page, Class<E> entityClass);

    /**
     * 根据查询条件查询数量
     *
     * @param qo
     * @return
     */
    Long countByQO(IQuery qo);
}
